class CreateStoreStaffSalaries < ActiveRecord::Migration[5.0]
  def change
    create_table :store_staff_salaries do |t|
      t.integer :store_id
      t.integer :store_staff_id
      t.decimal :basic
      t.json :subsidy
      t.json :insurance
      t.string :commission
      t.decimal :subsidy_amount
      t.decimal :insurance_amount
      t.decimal :commission_amount
      t.string :created_month
      t.boolean :status, default: false
      t.decimal :actual_amount
      t.decimal :debit_total
      t.decimal :discipline_amount
      t.decimal :attendence_amount
      t.decimal :reward_amount
      t.decimal :overtime_amount
      t.decimal :reward_total

      t.timestamps
    end
    add_index :store_staff_salaries, :store_staff_id
  end
end
